//----------------------------------------------------------------------------
// M A R I T I M E  R E S E A R C H  I N S T I T U T E  N E T H E R L A N D S
//----------------------------------------------------------------------------
// Copyright (C) 2012 - MARIN - All rights reserved - http://www.marin.nl
//----------------------------------------------------------------------------
// Program    : mermaid
// Module     : vbm
// File       : shiftpsi_kernels.h
// Author     : M.A. de Jong
//----------------------------------------------------------------------------

#ifndef SHIFTPSI_KERNELS_H
#define SHIFTPSI_KERNELS_H

namespace wavescomputer
{

template <class T>
__global__ void kernel_shiftpsi(T* psim2, T* psim1, 
                                const T* psi,
                                const int ld)
{
    int u = bx * Bx + tx;
    int v = by * By + ty;
    int tid = v * ld + u;

    psim2[tid] = psim1[tid];
    psim1[tid] = psi  [tid];
}

} // namespace wavescomputer

#endif // SHIFTPSI_KERNELS_H

